<template>
	<view class="msglist">
		<view class="msg">
			<view class="title">{{details.title}}</view>
			<view class="time">发布时间：{{ details.pubTime }}</view>
			<view class="nr" v-if="details.content"><rich-text :nodes="details.content" style="font-size: 20rpx;"></rich-text></view>
		</view>
	</view>
</template>
<script>
import news from '../../../servers/shop/news.js';
import dateFormat from '../../../common/dateFormat.js';
export default {
	data() {
		return {
			id: 0,
			details: []
		};
	},
	onReady(){
		uni.setNavigationBarTitle({
		    title: this.commonality.route_get('title', this.$route)
		});
	},
	mounted() {
		// this.id = uni.getStorageSync('shopnewsnews') || this.$route.query.shopnewsnews;
		
		 
		this.id = this.commonality.route_get('shopnewsnews', this.$route);
		news.newsdetails(this.id + '')
			.then(res => {
				this.details = res.data;
				this.details.pubTime = dateFormat.dateFormat('Y-mm-dd HH:MM:SS', new Date(res.data.pubTime));
			})
			.catch(err => {
				console.log(new Error('请检查网络后重试'));
			});
	},
	methods: {}
};
</script>

<style lang="less" scoped>
.msglist {
	.msg {
		background: #fff;
		padding: 20rpx;
		box-sizing: border-box;
		.title {
			font-size: 34rpx;
			line-height: 60rpx;
		}
		.time {
			text-align: right;
			font-size: 26rpx;
			color: #666666;
			margin: 20rpx 0;
		}
		.nr {
		}
	}
}
</style>
